﻿using System.Collections.Generic;
using System.Linq;
using System;
using System.Runtime.InteropServices;
using System.Text;

using MyUtils.PInvoke.Consts;

namespace MyUtils.PInvoke.Structs
{
	/// <summary>
	/// http://msdn.microsoft.com/en-us/library/bb773205(v=VS.85).aspx
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	struct BrowseInfo
	{
		public IntPtr Owner;
		public IntPtr pidlRoot;

		[MarshalAs(UnmanagedType.LPTStr, SizeConst = C.MAX_PATH)] //LPCTSTR assumed here to be MAX_PATH
		public string pszDisplayName;

		[MarshalAs(UnmanagedType.LPTStr)] //LPTSTR
		public string Title;

		public uint Flags;
		public BrowseFolderCallbackProc callback;
		public IntPtr lParam;
		public int iImage;

		public static BrowseInfo New()
		{
			return new BrowseInfo
			{
				pszDisplayName = new string('\0',C.MAX_PATH),
				Title = string.Empty,
			};
		}
	}
}